/**
 * @(#) Menu.java
 */

package TheRestaurantOwner;

public class Menu
{
	private int costOfHighQualityDish;
	private int costOfLowQualityDish;
	private int costOfHighQualityBeverage;
	private int costOfLowQualityBeverage;
	
	private Dish[] dishes;
	
	private Beverage[] beverages;

	public Menu( )
	{
		dishes = new Dish[5];
		beverages = new Beverage[5];
	}

	public int getCost( MenuItem item )
	{
		if (item.getQuality() == ItemQuality.low){
			if (item instanceof Dish){
				return costOfLowQualityDish;
			}
			return costOfLowQualityBeverage;
		}
		if (item instanceof Dish){
			return costOfHighQualityDish;
		}
		return costOfHighQualityBeverage;
	}
	
	public Dish getDish( int index )
	{
		return dishes[index];
	}
	
	public void setDish( int index, Dish dish )
	{
		dishes[index] = dish;
	}

	public Beverage getBeverage( int index )
	{
		return beverages[index];
	}
	
	public void setBeverage( int index, Beverage beverage )
	{
		beverages[index] = beverage;
	}

	public void setCosts( int lowQDish, int highQDish, int lowQBeverage, int highQBeverage )
	{
		costOfLowQualityDish = lowQDish;
		costOfHighQualityDish = highQDish;
		costOfLowQualityBeverage = lowQBeverage;
		costOfHighQualityBeverage = highQBeverage;
	}
}
